package com.goodmr.passport.account;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 帐号状态值
 *
 * @author <a href="mailto:bingdong13@msn.com">bigo</a>
 */
@Getter
@AllArgsConstructor
public enum AccountStatusEnum {

    INACTIVE(0, "未激活"),
    NORMAL(1, "正常"),
    LOCKED(2, "锁定");

    private int value;

    private String desc;

    public static AccountStatusEnum get(int value) {

        for (AccountStatusEnum enumValue : AccountStatusEnum.values()) {
            if (enumValue.getValue() == value) {
                return enumValue;
            }
        }

        return AccountStatusEnum.INACTIVE;
    }
}
